package com.yunfei.utils.jdbc;
import com.yunfei.contants.ApplicationConstant;
import org.springframework.core.env.Environment;
/**
 * @program: springclould_ylcaifu_App
 * @description: aiiidb获取数据库连接方法
 * @author: zhengyunfei
 * @create: 2019-07-08 11:34
 **/
public class AiiidbUtil {
    private String jdbcUrl;
    private String driveClassName;
    private  String jdbcUserName;
    private String jdbcPassword;
    //jdb获取数据库连接
    public static AiiidbUtil getInstance(Environment env){
        AiiidbUtil reulst=new AiiidbUtil();
        String jdbcUrl=env.getProperty(ApplicationConstant.JDBC_URL);
        String driveClassName=env.getProperty(ApplicationConstant.driverClassName);
        String jdbcUserName=env.getProperty(ApplicationConstant.USERNAME);
        String jdbcPassword=env.getProperty(ApplicationConstant.PASSWORD);
        reulst.setJdbcUrl(jdbcUrl);
        reulst.setDriveClassName(driveClassName);
        reulst.setJdbcUserName(jdbcUserName);
        reulst.setJdbcPassword(jdbcPassword);
        return  reulst;
    }

    public String getJdbcUrl() {
        return jdbcUrl;
    }

    public void setJdbcUrl(String jdbcUrl) {
        this.jdbcUrl = jdbcUrl;
    }

    public String getDriveClassName() {
        return driveClassName;
    }

    public void setDriveClassName(String driveClassName) {
        this.driveClassName = driveClassName;
    }

    public String getJdbcUserName() {
        return jdbcUserName;
    }

    public void setJdbcUserName(String jdbcUserName) {
        this.jdbcUserName = jdbcUserName;
    }

    public String getJdbcPassword() {
        return jdbcPassword;
    }

    public void setJdbcPassword(String jdbcPassword) {
        this.jdbcPassword = jdbcPassword;
    }
}
